﻿<?xml version = "1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
    <xsl:output method="html"/>

    <xsl:template match = "/">
        <table border="0" cellspacing="0" cellpadding="5">
            <tr>
                <td width="2%">&#160;</td>
                <td width="98%">
                    <span id = "DisplayFieldNameSpan"></span>
                    <span style = "display:none" id = "FieldNameSpan" datasrc = "#Xml_FieldInfo" datafld = "FieldName">
                        <xsl:value-of select="/Field/FieldInfo/FieldName"/>
                    </span>&#160;
                </td>
            </tr>
            <tr>
                <td width="2%">&#160;</td>
                <td width="98%">
                    <span id = "DisplayFieldDescSpan" ></span>
                    <span style = "display:none" id = "FieldDescSpan" datasrc = "#Xml_FieldInfo" datafld = "FieldDesc">
                        <xsl:value-of select="/Field/FieldInfo/FieldDesc"/>
                    </span>&#160;
                </td>
            </tr>
            <tr>
                <td width="2%">&#160;</td>
                <td width="98%">
                    <xsl:apply-templates />
                </td>
            </tr>
        </table>
    </xsl:template>

    <xsl:template match="/Fields" priority="1">
        <table border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <xsl:for-each select = "Field[@SID != '2']">
                        <table border="0" width="100%" cellspacing="0" cellpadding="5">
                            <tr>
                                <td width="2%">
                                    <!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>.-->
                                    <span id = "QNum"></span>
                                </td>
                                <td width="98%">
                                    <span id = "FieldNameSpan" >
                                        <xsl:value-of select="./@FieldName"/>
                                    </span>&#160;
                                </td>
                            </tr>
                            <xsl:if test = "@FieldDesc != ''">
                                <tr>
                                    <td width="2%">&#160;</td>
                                    <td width="98%">
                                        <span id = "FieldDescSpan">
                                            <xsl:apply-templates select="./@FieldDesc"/>
                                        </span>&#160;
                                    </td>
                                </tr>
                            </xsl:if>
                            <tr>
                                <td width="2%">&#160;</td>
                                <td width="98%">
                                    <xsl:apply-templates select = "."/>
                                </td>
                            </tr>
                        </table>
                    </xsl:for-each>
                </td>
            </tr>
        </table>
    </xsl:template>

    <!--Handle whitespace-->
    <xsl:template match="@FieldDesc">
        <span class="jq_fielddesc" dataformatas="html">
            <xsl:value-of select="."/>
        </span>
    </xsl:template>

    <xsl:template match = "Field">
        <xsl:if test = '@TypeID = "1"'>
            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                    <tr>
                        <td>
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td class="frminput">
                                        <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer" datafld = "Answer1">
                                            <tr>
                                                <td width = "100%">
                                                    <span id = "Controls_Span">
                                                        <input datafld = "_text">
                                                            <xsl:attribute name = 'type'>checkbox</xsl:attribute>
                                                            <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                                <xsl:attribute name = 'checkedvalue'>
                                                                    <LP0001/>
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'uncheckedvalue'>
                                                                    <LP0005/>
                                                                </xsl:attribute>
                                                            </xsl:if>
                                                            <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                                <xsl:attribute name = 'checkedvalue'>
                                                                    <LP0002/>
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'uncheckedvalue'>
                                                                    <LP0006/>
                                                                </xsl:attribute>
                                                            </xsl:if>
                                                            <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                                <xsl:attribute name = 'checkedvalue'>
                                                                    <LP0003/>
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'uncheckedvalue'>
                                                                    <LP0007/>
                                                                </xsl:attribute>
                                                            </xsl:if>
                                                            <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                                <xsl:attribute name = 'checkedvalue'>
                                                                    <LP0004/>
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'uncheckedvalue'>
                                                                    <LP0008/>
                                                                </xsl:attribute>
                                                            </xsl:if>
                                                            <xsl:attribute name = 'name'>
                                                                optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                            </xsl:attribute>
                                                            <xsl:attribute name = 'id'>
                                                                optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                            </xsl:attribute>
                                                        </input>
                                                    </span>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                    <tr>
                        <td width = "100%">
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td width = "100%" class="frminput">
                                        <span id = "Controls_Span">
                                            <input datafld = "Answer1">
                                                <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                    <xsl:attribute name = 'value'></xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0001/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0002/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0003/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0004/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:attribute name = 'name'>
                                                    optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                </xsl:attribute>
                                                <xsl:attribute name = 'id'>
                                                    optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                </xsl:attribute>
                                            </input>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                <span id = "True_Span"></span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                <span id = "True_Span">
                                                    <LP0001/>
                                                </span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                <span id = "True_Span">
                                                    <LP0002/>
                                                </span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                <span id = "True_Span">
                                                    <LP0003/>
                                                </span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                <span id = "True_Span">
                                                    <LP0004/>
                                                </span>
                                            </xsl:if>
                                            &#160;&#160;&#160;&#160;&#160;
                                            <input datafld = "Answer1">
                                                <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                    <xsl:attribute name = 'value'></xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0005/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0006/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0007/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                    <xsl:attribute name = 'value'>
                                                        <LP0008/>
                                                    </xsl:attribute>
                                                </xsl:if>
                                                <xsl:attribute name = 'name'>
                                                    optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                </xsl:attribute>
                                                <xsl:attribute name = 'id'>
                                                    optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                </xsl:attribute>
                                            </input>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                <span id = "False_Span"></span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                <span id = "False_Span">
                                                    <LP0005/>
                                                </span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                <span id = "False_Span">
                                                    <LP0006/>
                                                </span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                <span id = "False_Span">
                                                    <LP0007/>
                                                </span>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                <span id = "False_Span">
                                                    <LP0008/>
                                                </span>
                                            </xsl:if>
                                        </span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '3']">
                    <tr>
                        <td width = "100%">
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td width = "100%" class="frminput">
                                        <input datafld = "Answer1">
                                            <xsl:attribute name = 'type'>radio</xsl:attribute>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                <xsl:attribute name = 'value'></xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0001/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0002/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0003/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0004/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:attribute name = 'name'>
                                                optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'id'>
                                                optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                        </input>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                            <span id = "True_Span"></span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                            <span id = "True_Span">
                                                <LP0001/>
                                            </span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                            <span id = "True_Span">
                                                <LP0002/>
                                            </span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                            <span id = "True_Span">
                                                <LP0003/>
                                            </span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                            <span id = "True_Span">
                                                <LP0004/>
                                            </span>
                                        </xsl:if>
                                    </td>
                                </tr>
                                <tr>
                                    <td width = "100%" class="frminput">
                                        <input datafld = "Answer1">
                                            <xsl:attribute name = 'type'>radio</xsl:attribute>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                <xsl:attribute name = 'value'></xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0005/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0006/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0007/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                <xsl:attribute name = 'value'>
                                                    <LP0008/>
                                                </xsl:attribute>
                                            </xsl:if>
                                            <xsl:attribute name = 'name'>
                                                optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'id'>
                                                optChoice<xsl:value-of select = "./@FID"/>_<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                        </input>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                            <span id = "False_Span"></span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                            <span id = "False_Span">
                                                <LP0005/>
                                            </span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "2"]'>
                                            <span id = "False_Span">
                                                <LP0006/>
                                            </span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "3"]'>
                                            <span id = "False_Span">
                                                <LP0007/>
                                            </span>
                                        </xsl:if>
                                        <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                            <span id = "False_Span">
                                                <LP0008/>
                                            </span>
                                        </xsl:if>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '4']">
                    <tr>
                        <td width = "100%">
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td width = "100%" class="frminput">
                                        <span id = "Controls_Span">
                                            <select id = "PreviewDropDown" name = "PreviewDropDown" class = "frminput" datafld = "Answer1">
                                                <option value = ""></option>
                                                <xsl:attribute name = 'name'>
                                                    optChoice<xsl:value-of select = "./@FID"/>
                                                </xsl:attribute>
                                                <xsl:attribute name = 'id'>
                                                    optChoice<xsl:value-of select = "./@FID"/>
                                                </xsl:attribute>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "0"]'>
                                                    <option value = ""></option>
                                                    <option value = ""></option>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "1"]'>
                                                    <option value = "True">
                                                        <LP0001/>
                                                    </option>
                                                    <option value = "False">
                                                        <LP0005/>
                                                    </option>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[.  = "2"]'>
                                                    <option value = "T">
                                                        <LP0002/>
                                                    </option>
                                                    <option value = "F">
                                                        <LP0006/>
                                                    </option>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[.  = "3"]'>
                                                    <option value = "Yes">
                                                        <LP0003/>
                                                    </option>
                                                    <option value = "No">
                                                        <LP0007/>
                                                    </option>
                                                </xsl:if>
                                                <xsl:if test = 'FieldDetail/DisplayText[. = "4"]'>
                                                    <option value = "Y">
                                                        <LP0004/>
                                                    </option>
                                                    <option value = "N">
                                                        <LP0008/>
                                                    </option>
                                                </xsl:if>
                                            </select>
                                        </span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
            </table>
        </xsl:if>
        <xsl:if test = '@TypeID = "2"'>
            <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                    <tr>
                        <td>
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td class="frminput">
                                        <Select class="frminput">
                                            <xsl:attribute name = 'size'>1</xsl:attribute>
                                            <xsl:attribute name = 'name'>
                                                FldChoice<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'datafld'>Answer1</xsl:attribute>
                                            <option>
                                                <xsl:attribute name = 'value'></xsl:attribute>
                                            </option>
                                            <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1' or @SID = '3']">
                                                <xsl:if test = '. != ""'>
                                                    <option>
                                                        <xsl:attribute name = 'value'>
                                                            <xsl:value-of select="text()"/>
                                                        </xsl:attribute>
                                                        <xsl:value-of select="text()"/>
                                                    </option>
                                                </xsl:if>
                                            </xsl:for-each>
                                        </Select>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                    <tr>
                        <td width="100%">
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1' or @SID = '3']">
                                    <xsl:if test = '. != ""'>
                                        <tr>
                                            <td width="30" valign = "top">
                                                <input class = "frminput" type = "radio">
                                                    <xsl:attribute name = 'id'>
                                                        FldChoice<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>-->
                                                    </xsl:attribute>
                                                    <xsl:attribute name = 'name'>
                                                        FldChoice<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>-->
                                                    </xsl:attribute>
                                                    <xsl:attribute name = 'value'>
                                                        <xsl:value-of select="."/>
                                                    </xsl:attribute>
                                                    <xsl:attribute name = 'datafld'>Answer1</xsl:attribute>
                                                </input>
                                            </td>
                                            <td valign = "top">
                                                <xsl:value-of select="text()"/>
                                            </td>
                                        </tr>
                                    </xsl:if>
                                </xsl:for-each>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '3']">
                    <tr>
                        <td>
                            <table border="0" cellspacing="0" cellpadding="0" width="100%" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td>
                                        <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1' or @SID = '3']">
                                            <xsl:if test = '. != ""'>
                                                <input class = "frminput" type = "radio">
                                                    <xsl:attribute name = 'id'>
                                                        FldChoice<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>-->
                                                    </xsl:attribute>
                                                    <xsl:attribute name = 'name'>
                                                        FldChoice<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>-->
                                                    </xsl:attribute>
                                                    <xsl:attribute name = 'value'>
                                                        <xsl:value-of select="text()"/>
                                                    </xsl:attribute>
                                                    <xsl:attribute name = 'datafld'>Answer1</xsl:attribute>
                                                </input>
                                                <xsl:value-of select="text()"/>
                                            </xsl:if>
                                        </xsl:for-each>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
            </table>
        </xsl:if>
        <xsl:if test = '@TypeID = "3"'>
            <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF" cellspacing="0" cellpadding="0" width = "100%" datasrc = "#TheAnswer">
                <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                    <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1' or @SID = '3']">
                        <xsl:if test = '. != ""'>
                            <tr>
                                <td width="100%">
                                    <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                        <xsl:attribute name = "datafld">
                                            Field<xsl:value-of select = "../../../@FID"/>
                                        </xsl:attribute>
                                        <tr>
                                            <td width="100%" >
                                                <table border="0" width = "100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                                    <xsl:attribute name = "datafld">
                                                        Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                    </xsl:attribute>
                                                    <tr>
                                                        <td width = "30" valign = "top">
                                                            <input class = "frminput" type = "checkbox" datafld = "_text">
                                                                <xsl:attribute name = 'id'>
                                                                    FldChoice<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'name'>
                                                                    FldChoice<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'checkedvalue'>
                                                                    <xsl:value-of select="."/>
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'uncheckedvalue'></xsl:attribute>
                                                            </input>

                                                        </td>
                                                        <td valign = "top">
                                                            <xsl:value-of select="text()"/>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </xsl:if>
                    </xsl:for-each>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                    <tr>
                        <td width="100%">
                            <table border="0" width = "100%" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="100%">
                                        <Select class="frminput" multiple = "1">
                                            <xsl:attribute name = 'size'>5</xsl:attribute>
                                            <xsl:attribute name = 'name'>
                                                FldChoice<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <option value = ''></option>
                                            <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1' or @SID = '3']">
                                                <xsl:if test = '. != ""'>
                                                    <option>
                                                        <xsl:attribute name = 'value'>
                                                            <!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                        </xsl:attribute>
                                                        <xsl:value-of select="."/>
                                                    </option>
                                                </xsl:if>
                                            </xsl:for-each>
                                        </Select>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
            </table>
        </xsl:if>
        <xsl:if test = '@TypeID = "4"'>
            <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="5">
                    <tr>
                        <td width = "100%" colspan = "3">
                            (
                            <xsl:if test = "FieldDetail/RankDescs/RankDesc[0][. != '' and @SID != '2']">
                                1&#160;=&#160;<xsl:value-of select="FieldDetail/RankDescs/RankDesc[0]"/>
                            </xsl:if>
                            <xsl:if test = "FieldDetail/RankDescs/RankDesc[1][. != '' and @SID != '2']">
                                , 2&#160;=&#160;<xsl:value-of select="FieldDetail/RankDescs/RankDesc[1]"/>
                            </xsl:if>
                            <xsl:if test = "FieldDetail/RankDescs/RankDesc[2][. != '' and @SID != '2']">
                                , 3&#160;=&#160;<xsl:value-of select="FieldDetail/RankDescs/RankDesc[2]"/>
                            </xsl:if>
                            <xsl:if test = "FieldDetail/RankDescs/RankDesc[3][. != '' and @SID != '2']">
                                , 4&#160;=&#160;<xsl:value-of select="FieldDetail/RankDescs/RankDesc[3]"/>
                            </xsl:if>
                            <xsl:if test = "FieldDetail/RankDescs/RankDesc[4][. != '' and @SID != '2']">
                                , 5&#160;=&#160;<xsl:value-of select="FieldDetail/RankDescs/RankDesc[4]"/>
                            </xsl:if>
                            )
                        </td>
                    </tr>
                    <tr>
                        <td width = "100%" colspan = "3"></td>
                    </tr>
                </table>
                <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="40%" colspan = "2" valign = "top">&#160;</td>
                        <td width = "60%" align = "left">
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                        <table border="0" cellspacing="0" cellpadding="0">
                                            <tr>

                                                <xsl:for-each select = "FieldDetail/RankDescs/RankDesc[@SID = '1' or @SID = '3']">
                                                    <xsl:if test = ". != ''">
                                                        <td width = "50" align = "center">
                                                            <!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                        </td>
                                                    </xsl:if>
                                                </xsl:for-each>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1' or @SID = '3']">
                        <xsl:if test = '. != ""'>
                            <tr>
                                <td width="40%" colspan = "2" valign = "top">
                                    <xsl:value-of select="text()"/>&#160;&#160;&#160;&#160;&#160;
                                </td>
                                <td width = "60%" align = "left" valign = "top">
                                    <table border="0" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                        <tr>
                                            <td  valign = "top">
                                                <table border="0" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                                    <xsl:attribute name = "datafld">
                                                        Field<xsl:value-of select = "../../../@FID"/>
                                                    </xsl:attribute>
                                                    <tr>
                                                        <xsl:if test = "../../RankDescs/RankDesc[0][. != '' and @SID != '2']">
                                                            <td  width = "50" valign = "top" align = "center">
                                                                <input>
                                                                    <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                                    <xsl:attribute name = 'value'>
                                                                        <xsl:value-of select = "../../RankDescs/RankDesc[0]/text()"/>
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'name'>
                                                                        optRank<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>--><!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'datafld'>
                                                                        Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                </input>
                                                            </td>
                                                        </xsl:if>
                                                        <xsl:if test = "../../RankDescs/RankDesc[1][. != '' and @SID != '2']">
                                                            <td width = "50" valign = "top" align = "center">
                                                                <input >
                                                                    <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                                    <xsl:attribute name = 'value'>
                                                                        <xsl:value-of select = "../../RankDescs/RankDesc[1]/text()"/>
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'name'>
                                                                        optRank<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>--><!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'datafld'>
                                                                        Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                </input>
                                                            </td>
                                                        </xsl:if>
                                                        <xsl:if test = "../../RankDescs/RankDesc[2][. != '' and @SID != '2']">
                                                            <td  width = "50" valign = "top" align = "center">
                                                                <input >
                                                                    <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                                    <xsl:attribute name = 'value'>
                                                                        <xsl:value-of select = "../../RankDescs/RankDesc[2]/text()"/>
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'name'>
                                                                        optRank<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>--><!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'datafld'>
                                                                        Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                </input>
                                                            </td>
                                                        </xsl:if>
                                                        <xsl:if test = "../../RankDescs/RankDesc[3][. != '' and @SID != '2']">
                                                            <td  width = "50" valign = "top" align = "center">
                                                                <input >
                                                                    <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                                    <xsl:attribute name = 'value'>
                                                                        <xsl:value-of select = "../../RankDescs/RankDesc[3]/text()"/>
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'name'>
                                                                        optRank<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>--><!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'datafld'>
                                                                        Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                </input>
                                                            </td>
                                                        </xsl:if>
                                                        <xsl:if test = "../../RankDescs/RankDesc[4][. != '' and @SID != '2']">
                                                            <td  width = "50" valign = "top" align = "center">
                                                                <input >
                                                                    <xsl:attribute name = 'type'>radio</xsl:attribute>
                                                                    <xsl:attribute name = 'value'>
                                                                        <xsl:value-of select = "../../RankDescs/RankDesc[4]/text()"/>
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'name'>
                                                                        optRank<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval>--><!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                    <xsl:attribute name = 'datafld'>
                                                                        Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                    </xsl:attribute>
                                                                </input>
                                                            </td>
                                                        </xsl:if>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr>
                                <td height = "10" colspan = "2" width = "100%"></td>
                            </tr>
                        </xsl:if>
                    </xsl:for-each>
                </table>
            </xsl:if>
            <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF" cellspacing="0" cellpadding="5">
                    <xsl:for-each select = "FieldDetail/Choices/Choice[@SID = '1'] | FieldDetail/Choices/Choice[@SID = '3']">
                        <xsl:if test = '. != ""'>
                            <tr>
                                <td width="30%" colspan = "2">
                                    <xsl:value-of select="text()"/>
                                </td>
                                <td width = "70%" align = "left">
                                    <table border="0" cellspacing="0" cellpadding="5" datasrc = "#TheAnswer">
                                        <tr>
                                            <td width = "100%">
                                                <table width="100%" border="0" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                                                    <xsl:attribute name = "datafld">
                                                        Field<xsl:value-of select = "../../../@FID"/>
                                                    </xsl:attribute>
                                                    <tr>
                                                        <td class="frminput" align="center" width = "20%">
                                                            <select class = "frminput">
                                                                <xsl:attribute name = "datafld">
                                                                    Answer<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                </xsl:attribute>
                                                                <xsl:attribute name = 'name'>
                                                                    optRank<!--<xsl:eval>formatIndex(ancestorChildNumber("Field", this),"1")</xsl:eval><xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                                </xsl:attribute>
                                                                <option value = ""></option>
                                                                <xsl:for-each select = "../../RankDescs/RankDesc[@SID = '1'] | ../../RankDescs/RankDesc[@SID = '3']">
                                                                    <xsl:if test = ". != ''">
                                                                        <option>
                                                                            <xsl:attribute name = "value">
                                                                                <xsl:value-of select = "."/>
                                                                            </xsl:attribute>
                                                                            <xsl:value-of select = "."/>
                                                                        </option>
                                                                    </xsl:if>
                                                                </xsl:for-each>
                                                            </select>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </xsl:if>
                    </xsl:for-each>
                </table>
            </xsl:if>
        </xsl:if>
        <xsl:if test = '@TypeID = "5"'>
            <table border="0" width="100%" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                    <tr>
                        <td width = "100%">
                            <table cellpadding = "0" cellspacing = "0" border = "0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <!--
								<xsl:if test = "FieldDetail/DisplaySign[.!text() = '1']">
									<td>
					  					<select class = "frminput" datasrc = "#TheAnswer" datafld = "Sign">
					  					<option value = ""></option>
					  					<xsl:attribute name = 'name'>cboSign<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval></xsl:attribute>
					  					<option><xsl:attribute name = 'value'>&gt;</xsl:attribute>&gt;</option>
					  					<option><xsl:attribute name = 'value'>&gt;=</xsl:attribute>&gt;=</option>
					  					<option><xsl:attribute name = 'value'>=</xsl:attribute>=</option>
					  					<option><xsl:attribute name = 'value'>&lt;&gt;</xsl:attribute>&lt;&gt;</option>
					  					<option><xsl:attribute name = 'value'>&lt;=</xsl:attribute>&lt;=</option>
					  					<option><xsl:attribute name = 'value'>&lt;</xsl:attribute>&lt;</option>
					  					</select>
					  				</td>
					  			</xsl:if>
-->
                                    <xsl:if test = "FieldDetail/Prefix[. != '']">
                                        <td>
                                            &#160;
                                            <xsl:value-of select="FieldDetail/Prefix"/>
                                        </td>
                                    </xsl:if>
                                    <td>
                                        &#160;
                                        <input  class = "frminput">
                                            <xsl:attribute name = 'type'>text</xsl:attribute>
                                            <xsl:attribute name = 'name'>
                                                Num<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'size'>10</xsl:attribute>
                                            <xsl:attribute name = 'datafld'>FromNum</xsl:attribute>
                                        </input>
                                    </td>
                                    <xsl:if test = "FieldDetail/Suffix[. != '']">
                                        <td>
                                            &#160;
                                            <xsl:value-of select="FieldDetail/Suffix"/>
                                        </td>
                                    </xsl:if>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                    <tr>
                        <td width = "100%">
                            <table cellpadding = "0" cellspacing = "0" border = "0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td>
                                        <LP0009/>
                                    </td>
                                    <xsl:if test = "FieldDetail/Prefix[. != '']">
                                        <td>
                                            &#160;
                                            <xsl:value-of select="FieldDetail/Prefix"/>
                                        </td>
                                    </xsl:if>
                                    <td>
                                        &#160;
                                        <input class = "frminput">
                                            <xsl:attribute name = 'type'>text</xsl:attribute>
                                            <xsl:attribute name = 'name'>
                                                FromNum<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'size'>10</xsl:attribute>
                                            <xsl:attribute name = 'datafld'>FromNum</xsl:attribute>
                                        </input>
                                    </td>
                                    <td>
                                        &#160;<LP0010/>
                                    </td>
                                    <td>
                                        &#160;
                                        <input  class = "frminput">
                                            <xsl:attribute name = 'type'>text</xsl:attribute>
                                            <xsl:attribute name = 'name'>
                                                ToNum<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'size'>10</xsl:attribute>
                                            <xsl:attribute name = 'datafld'>ToNum</xsl:attribute>
                                        </input>
                                    </td>
                                    <xsl:if test = "FieldDetail/Suffix[. != '']">
                                        <td>
                                            &#160;
                                            <xsl:value-of select="FieldDetail/Suffix"/>
                                        </td>
                                    </xsl:if>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
            </table>
        </xsl:if>
        <xsl:if test = '@TypeID = "6"'>
            <table border="0" width="100%" cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                    <tr>
                        <td width = "100%">
                            <table cellpadding = "0" cellspacing = "0" border = "0" datasrc = "#TheAnswer">
                                <xsl:attribute name = "datafld">
                                    Field<xsl:value-of select = "./@FID"/>
                                </xsl:attribute>
                                <tr>
                                    <td>
                                        <xsl:if test = "FieldDetail/DateFormat[. = '1']">
                                            <input class = "frminput">
                                                <xsl:attribute name = 'type'>text</xsl:attribute>
                                                <xsl:attribute name = 'name'>
                                                    txtFromDay<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                </xsl:attribute>
                                                <xsl:attribute name = 'size'>2</xsl:attribute>
                                                <xsl:attribute name = 'maxlength'>2</xsl:attribute>
                                                <xsl:attribute name = 'datafld'>FromDay</xsl:attribute>
                                            </input>
                                        </xsl:if>
                                    </td>
                                    <td>
                                        <xsl:if test = "FieldDetail/DateFormat[. = '1' or . = '2']">
                                            <select  class = "frminput">
                                                <xsl:attribute name = 'name'>
                                                    cboFromMonth<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                </xsl:attribute>
                                                <xsl:attribute name = 'datafld'>FromMonth</xsl:attribute>
                                                <option value = ""></option>
                                                <option value = "January">
                                                    <LP0011/>
                                                </option>
                                                <option value = "February">
                                                    <LP0012/>
                                                </option>
                                                <option value = "March">
                                                    <LP0013/>
                                                </option>
                                                <option value = "April">
                                                    <LP0014/>
                                                </option>
                                                <option value = "May">
                                                    <LP0015/>
                                                </option>
                                                <option value = "June">
                                                    <LP0016/>
                                                </option>
                                                <option value = "July">
                                                    <LP0017/>
                                                </option>
                                                <option value = "August">
                                                    <LP0018/>
                                                </option>
                                                <option value = "Semtember">
                                                    <LP0019/>
                                                </option>
                                                <option value = "October">
                                                    <LP0020/>
                                                </option>
                                                <option value = "November">
                                                    <LP0021/>
                                                </option>
                                                <option value = "December">
                                                    <LP0022/>
                                                </option>
                                            </select>
                                        </xsl:if>
                                    </td>
                                    <td>
                                        <input  class = "frminput">
                                            <xsl:attribute name = 'name'>
                                                txtFromYear<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                            </xsl:attribute>
                                            <xsl:attribute name = 'size'>4</xsl:attribute>
                                            <xsl:attribute name = 'type'>text</xsl:attribute>
                                            <xsl:attribute name = 'datafld'>FromYear</xsl:attribute>
                                            <xsl:attribute name = 'size'>4</xsl:attribute>
                                            <xsl:attribute name = 'maxlength'>4</xsl:attribute>
                                        </input>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
                <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                    <tr>
                        <td width = "100%">
                            <table border = "0" width = "100%" cellpadding = "0" cellspacing = "0">
                                <tr>
                                    <td >
                                        <LP0009/>&#160;
                                    </td>
                                    <td >
                                        <table cellpadding = "0" cellspacing = "0" border = "0" datasrc = "#TheAnswer">
                                            <xsl:attribute name = "datafld">
                                                Field<xsl:value-of select = "./@FID"/>
                                            </xsl:attribute>
                                            <tr>
                                                <td>
                                                    <xsl:if test = "FieldDetail/DateFormat[. = '1']">
                                                        <input class = "frminput">
                                                            <xsl:attribute name = 'type'>text</xsl:attribute>
                                                            <xsl:attribute name = 'name'>
                                                                txtFromDay<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                            </xsl:attribute>
                                                            <xsl:attribute name = 'size'>2</xsl:attribute>
                                                            <xsl:attribute name = 'maxlength'>2</xsl:attribute>
                                                            <xsl:attribute name = 'datafld'>FromDay</xsl:attribute>
                                                        </input>
                                                    </xsl:if>
                                                </td>
                                                <td>
                                                    <xsl:if test = "FieldDetail/DateFormat[. = '1' or . = '2']">
                                                        <select  class = "frminput">
                                                            <xsl:attribute name = 'name'>
                                                                cboFromMonth<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                            </xsl:attribute>
                                                            <xsl:attribute name = 'datafld'>FromMonth</xsl:attribute>
                                                            <option value = ""></option>
                                                            <option value = "January">
                                                                <LP0011/>
                                                            </option>
                                                            <option value = "February">
                                                                <LP0012/>
                                                            </option>
                                                            <option value = "March">
                                                                <LP0013/>
                                                            </option>
                                                            <option value = "April">
                                                                <LP0014/>
                                                            </option>
                                                            <option value = "May">
                                                                <LP0015/>
                                                            </option>
                                                            <option value = "June">
                                                                <LP0016/>
                                                            </option>
                                                            <option value = "July">
                                                                <LP0017/>
                                                            </option>
                                                            <option value = "August">
                                                                <LP0018/>
                                                            </option>
                                                            <option value = "Semtember">
                                                                <LP0019/>
                                                            </option>
                                                            <option value = "October">
                                                                <LP0020/>
                                                            </option>
                                                            <option value = "November">
                                                                <LP0021/>
                                                            </option>
                                                            <option value = "December">
                                                                <LP0022/>
                                                            </option>
                                                        </select>
                                                    </xsl:if>
                                                </td>
                                                <td>
                                                    <input  class = "frminput">
                                                        <xsl:attribute name = 'name'>
                                                            txtFromYear<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                        </xsl:attribute>
                                                        <xsl:attribute name = 'size'>4</xsl:attribute>
                                                        <xsl:attribute name = 'type'>text</xsl:attribute>
                                                        <xsl:attribute name = 'datafld'>FromYear</xsl:attribute>
                                                        <xsl:attribute name = 'size'>4</xsl:attribute>
                                                        <xsl:attribute name = 'maxlength'>4</xsl:attribute>
                                                    </input>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td >
                                        &#160;<LP0010/>&#160;
                                    </td>
                                    <td width = "100%">
                                        <table cellpadding = "0" cellspacing = "0" border = "0" datasrc = "#TheAnswer">
                                            <xsl:attribute name = "datafld">
                                                Field<xsl:value-of select = "./@FID"/>
                                            </xsl:attribute>
                                            <tr>
                                                <td>
                                                    <xsl:if test = "FieldDetail/DateFormat[. = '1']">
                                                        <input class = "frminput">
                                                            <xsl:attribute name = 'type'>text</xsl:attribute>
                                                            <xsl:attribute name = 'name'>
                                                                txtToDay<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                            </xsl:attribute>
                                                            <xsl:attribute name = 'size'>2</xsl:attribute>
                                                            <xsl:attribute name = 'maxlength'>2</xsl:attribute>
                                                            <xsl:attribute name = 'datafld'>ToDay</xsl:attribute>
                                                        </input>
                                                    </xsl:if>
                                                </td>
                                                <td>
                                                    <xsl:if test = "FieldDetail/DateFormat[. = '1' or . = '2']">
                                                        <select  class = "frminput">
                                                            <xsl:attribute name = 'name'>
                                                                cboToMonth<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                            </xsl:attribute>
                                                            <xsl:attribute name = 'datafld'>ToMonth</xsl:attribute>
                                                            <option value = ""></option>
                                                            <option value = "January">
                                                                <LP0011/>
                                                            </option>
                                                            <option value = "February">
                                                                <LP0012/>
                                                            </option>
                                                            <option value = "March">
                                                                <LP0013/>
                                                            </option>
                                                            <option value = "April">
                                                                <LP0014/>
                                                            </option>
                                                            <option value = "May">
                                                                <LP0015/>
                                                            </option>
                                                            <option value = "June">
                                                                <LP0016/>
                                                            </option>
                                                            <option value = "July">
                                                                <LP0017/>
                                                            </option>
                                                            <option value = "August">
                                                                <LP0018/>
                                                            </option>
                                                            <option value = "Semtember">
                                                                <LP0019/>
                                                            </option>
                                                            <option value = "October">
                                                                <LP0020/>
                                                            </option>
                                                            <option value = "November">
                                                                <LP0021/>
                                                            </option>
                                                            <option value = "December">
                                                                <LP0022/>
                                                            </option>
                                                        </select>
                                                    </xsl:if>
                                                </td>
                                                <td>
                                                    <input  class = "frminput">
                                                        <xsl:attribute name = 'name'>
                                                            txtToYear<!--<xsl:eval>formatIndex(childNumber(this),"1")</xsl:eval>-->
                                                        </xsl:attribute>
                                                        <xsl:attribute name = 'size'>4</xsl:attribute>
                                                        <xsl:attribute name = 'type'>text</xsl:attribute>
                                                        <xsl:attribute name = 'datafld'>ToYear</xsl:attribute>
                                                        <xsl:attribute name = 'size'>4</xsl:attribute>
                                                        <xsl:attribute name = 'maxlength'>4</xsl:attribute>
                                                    </input>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </xsl:if>
            </table>
        </xsl:if>
        <xsl:if test = '@TypeID = "7"'>
            <table border="0" width="100%" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="0" datasrc = "#TheAnswer">
                <tr>
                    <td width = "100%">
                        <table cellpadding = "0" cellspacing = "0" border = "0" datasrc = "#TheAnswer">
                            <xsl:attribute name = "datafld">
                                Field<xsl:value-of select = "./@FID"/>
                            </xsl:attribute>
                            <xsl:if test = "FieldDetail/DisplayFormat[. = '1']">
                                <tr>
                                    <td width = "100%">
                                        <input class = "frminput" id = "ShortTextBox" name = "ShortTextBox" type = "text" size = "25" maxlength = "50">
                                            <xsl:attribute name = 'datafld'>Txt</xsl:attribute>
                                        </input>
                                    </td>
                                </tr>
                            </xsl:if>
                            <xsl:if test = "FieldDetail/DisplayFormat[. = '2']">
                                <tr>
                                    <td width = "100%">
                                        <input class = "frminput" id = "LongTextBox" name = "LongTextBox" type = "text" size = "60" maxlength = "255">
                                            <xsl:attribute name = 'datafld'>Txt</xsl:attribute>
                                        </input>
                                    </td>
                                </tr>
                            </xsl:if>
                            <xsl:if test = "FieldDetail/DisplayFormat[. = '3']">
                                <tr>
                                    <td width = "100%">
                                        <textarea class = "frminput" id = "TextArea" name = "TextArea" cols = "80" rows = "10">
                                            <xsl:attribute name = 'datafld'>Txt</xsl:attribute>
                                            <![CDATA[]]>
                                        </textarea>
                                    </td>
                                </tr>
                            </xsl:if>
                        </table>
                    </td>
                </tr>
            </table>
        </xsl:if>
        <xsl:if test = '@TypeID = "8"'>
            <table border="0" cellspacing="0" cellpadding="5">
                <xsl:if test = "FieldDetail/ColNum[. != '0']">
                    <tr>
                        <xsl:if test = "FieldDetail/RowType[. != '1']">
                            <td valign = "bottom" style = "border-Bottom:2 double lightgrey">&#160;</td>
                        </xsl:if>
                        <xsl:for-each select = "FieldDetail/Headers/Header">
                            <!--
						<td style = "border-Bottom:2 double lightgrey" valign = "bottom">
-->
                            <td style="border-bottom: 1px dotted #C0C0C0;">

                                <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td valign = "bottom">
                                            <xsl:value-of select = "."/>&#160;
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </xsl:for-each>
                    </tr>
                </xsl:if>
                <xsl:for-each select = "FieldDetail/Cols">
                    <tr>
                        <xsl:for-each select = "./Field">
                            <xsl:choose>
                                <xsl:when test = "@TypeID = '9'">
                                    <xsl:choose>
                                        <xsl:when test = "./FieldDetail/Labels/Label[0][. != '']">
                                            <td valign = "top">
                                                <table border="0" bordercolorlight="#AFC0D3" bordercolordark="#FFFFFF"  cellspacing="0" cellpadding="0">
                                                    <tr>
                                                        <td valign = "bottom">
                                                            <xsl:value-of select = "./FieldDetail/Labels/Label[0]/text()"/>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <td valign = "top"></td>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:when>
                                <xsl:when test = "@TypeID = '0'">
                                    <td valign = "top"></td>
                                </xsl:when>
                                <xsl:otherwise>
                                    <td valign = "top">
                                        <xsl:apply-templates select = "."/>
                                    </td>
                                </xsl:otherwise>
                            </xsl:choose>
                        </xsl:for-each>
                    </tr>
                </xsl:for-each>
            </table>
        </xsl:if>
    </xsl:template>


</xsl:stylesheet>